<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/checkbix.min.css" />
<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/public.css" />
<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/mui.min.css">
<script src="<?php echo APP_TEMPLATES_URL;?>/js/checkbix.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo APP_TEMPLATES_URL;?>/js/mui.min.js"></script>
<script type="text/javascript" src="<?php echo APP_SITE_URL;?>/js/zepto.min.js"></script>
<script type="text/javascript" src="<?php echo APP_SITE_URL;?>/js/template.js"></script>
<style>
	body{background: #F4F4F4;}
	.nobor table:last-child{ border: 0px !important;}
	.height69{display: none;}
</style>
<script>
	function go_back(){
		window.location.href = 'index.php?act=member';
	}
</script>
<body>
	<!-- 导航 -->
	<div class="mui-bar mui-bar-nav bj" style="background: #F4F4F4;">
		<button id="zhuce" class="mui-btn mui-btn-link mui-btn-nav mui-pull-left zys">
				<img style=" max-width: 70%; vertical-align: middle;" src="<?php echo APP_TEMPLATES_URL;?>/images/back.png" onclick="go_back()" />
			</button>
				<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right" style="margin-right: 5px;">
				<a href="<?php echo APP_SITE_URL;?>/index.php?act=member_points&op=integral_rule" style="color: #000000;">规则</a>
			</button>
		<h1 class="mui-title"><label style="font-size: 22px;vertical-align: middle; line-height: 44px;">我的积分</label></h1>
	</div>

	<table width="100%" style="text-align: center; background: #efb33e;">
		<tr>
			<td colspan="2">
				<img style="max-width: 100%; margin: 10px; margin-top: 20px; width: 72px;height: 65px;" id="imgfield2" src="<?php echo empty($output['member_info']['member_avatar']) ? APP_TEMPLATES_URL.'/images/m_03.png':UPLOAD_SITE_URL.DS.ATTACH_AVATAR.DS.$output['member_info']['member_avatar'];?>" />
				<p style="    font-size: 16px;    color: #000000;">我的积分</p>
				<p style="font-size: 28px;font-weight: 600;    font-size: 28px;    font-weight: 600;    margin: 10px 0 15px 0; color: #000000;">
					&nbsp;<?php echo $output['member_info']['member_points']; ?>&nbsp;</p>
			</td>
		</tr>
	</table>

	<div style="height: 13px; background: #F4F4F4; clear: both;"></div>

	<div class="mui-content" style="padding-top: 0;">
	<div id="pullrefresh" class="mui-content mui-scroll-wrapper" style="top: 240px;background-color: #FFFFFF;">
		<div class="mui-scroll">
	<div style="padding-left: 10px;" id="integral_content">

			<?php  if (count($output['list_log'])>0) { ?>
			<?php foreach($output['list_log'] as $val) { ?>

			<table style="border-bottom: 1px solid #DDDDDD;" width="100%">
				<tr>
					<td style="padding-top: 10px;width: 80%;"><label style="color: #666666;margin-left: 5px;font-size: 14px;"><?php echo $val['pl_desc'];?></label></td>
					<td rowspan="2" style="vertical-align: middle;color: #efb33e;font-size: 14px;">
						<?php echo ($val['pl_points'] > 0 ? '+' : '').$val['pl_points']; ?>
					</td>
				</tr>
				<tr>
					<td style="padding-bottom: 8px;padding-top: 5px;">
						<p style="color: #999999;margin-left: 5px;font-size: 14px;">
							<?php echo @date('Y-m-d H:i:s',$val['pl_addtime']);?>
						</p>
					</td>
				</tr>
			</table>
			<?php } } ?>

		</div>
</div>
	</div>
</div>
<script type="text/html" id="record-list">
		<%
		if(list_log.length >0){
		for (var i = 0;i<list_log.length;i++){
			var pl_points = list_log[i].pl_points > 0 ? '+':'';
		%>
		<table style="border-bottom: 1px solid #DDDDDD;" width="100%">
			<tr>
				<td style="padding-top: 10px;width: 80%;"><label style="color: #666666;margin-left: 5px;font-size: 14px;"><%=list_log[i].pl_desc%></label></td>
				<td rowspan="2" style="vertical-align: middle;color: #efb33e;font-size: 14px;"><%=pl_points+list_log[i].pl_points %></td>
			</tr>
			<tr>
				<td style="padding-bottom: 8px;padding-top: 5px;"><p style="color: #999999;margin-left: 5px;font-size: 14px;"><%=list_log[i].pl_addtime%></p></td>
			</tr>
		</table>
		<% }
		}%>
</script>


<script type="application/javascript">
	var curpage = 1;
	var totalPage = <?php echo $output['totalPage']; ?>;
	mui.init({
		pullRefresh: {
			container: '#pullrefresh',
			up: {
				contentrefresh: '正在加载...',
				callback: pullupRefresh
			}
		}
	});
	var count = 0;
	/**
	 * 上拉加载具体业务实现
	 */
	function pullupRefresh() {
		setTimeout(function() {
			mui('#pullrefresh').pullRefresh().endPullupToRefresh((totalPage<=curpage)); //参数为true代表没有更多数据了。
			if(totalPage>curpage) {
				$.getJSON("index.php?act=member_points&op=pointsListPage&curpage=" + curpage, function (e) {
					curpage = e.datas.curpage;
					$("#integral_content").append(template.render("record-list", e.datas));
				});
			}
		}, 1500);
	}
	
</script>

</body>